from blogs.models import Blog, Tag, Image, Post, Comment, Banned, Link, Image
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _

class CommentOptions(admin.ModelAdmin):
    list_display = ('blog', 'post', 'name', 'ip', 'message', 'date')
    list_filter = ('blog', 'post',)
    search_fieldsets = ['subject']
    date_hierarchy = 'date'

class BlogOptions(admin.ModelAdmin):
    list_display = ('name', 'description')
    prepopulated_fields = {'slug': ('name',)}

class TagOptions(admin.ModelAdmin):
    list_display = ('name', 'blog',)
    list_filter = ('blog',)

class PostOptions(admin.ModelAdmin):
    fieldsets = (
        ('Post information', {'fields': ('blog', 'title', 'slug', 'pub_date', 'byline', 'body', 'tags', 'comments_enabled', 'mod_user')}),
    )
    list_display = ('title', 'mod_date', 'pub_date', 'blog', 'byline',)
    list_filter = ('blog', 'pub_date',)
    search_fieldsets = ['title']
    date_hierarchy = 'pub_date'
    prepopulated_fields = {'slug': ('title',)}

#admin.site.register(Comment, CommentOptions)
#admin.site.register(Image)
admin.site.register(Blog, BlogOptions)
#admin.site.register(Tag, TagOptions)
#admin.site.register(Link)
#admin.site.register(Post, PostOptions)
#admin.site.register(Banned)

